// 生产环境
var ApiDoName = 'http://580fe044.nat123.fun/'
var ApiDoNameSocket = 'http://580fe044.nat123.fun/'

var ApiDoNameMember = ApiDoName + '/member-server/v001/'
var ApiDoNameAuth = ApiDoName + '/auth-server/v001/'
var ApiDoNameCommon = ApiDoName + '/common-server/v001/'

// 开发环境
if (location.hostname.indexOf('tinydev.cc') > -1) {
  ApiDoName = 'http://tinymall-api.tinydev.cc'
  ApiDoNameSocket = 'http://tinymall-api.tinydev.cc'
  ApiDoNameMember = ApiDoNameMember.replace('cn', 'cc')
  ApiDoNameAuth = ApiDoNameAuth.replace('cn', 'cc')
  ApiDoNameCommon = ApiDoNameCommon.replace('cn', 'cc')
}

// 本地环境
if (location.hostname.indexOf('127.0.0.1') > -1 || location.hostname.indexOf('localhost') > -1) {
  ApiDoName = 'http://127.0.0.1:9200'
  ApiDoNameMember = ApiDoName + '/member-server/v001/'
  ApiDoNameAuth = ApiDoName + '/auth-server/v001/'
  ApiDoNameCommon = ApiDoName + '/common-server/v001/'
  ApiDoNameSocket = 'http://127.0.0.1:9092'
}

// 本地局域网环境
if (location.hostname.indexOf('192.168.3.6') > -1) {
  ApiDoName = 'http://192.168.3.6:9200'
  ApiDoNameMember = ApiDoName + '/member-server/v001/'
  ApiDoNameAuth = ApiDoName + '/auth-server/v001/'
  ApiDoNameCommon = ApiDoName + '/common-server/v001/'
  ApiDoNameSocket = 'http://192.168.3.6:9092'
}

var AppVersion = 'v0.0.34'

var demoData = {
  cartList: [
    {
      shop: {id: '', name: '阳阳五金店', logo: 'https://yangfan-shop.oss-cn-hangzhou.aliyuncs.com/shop/logo/1.jpg'},
      productList: [
        {
          'id': 69,
          'image': 'http://image.yangfankj.com/product/8/8/0.png',
          'name': '同仁堂-蛇毒 眼霜',
          'price': 78,
          'model': '白,大',
          'nums': 4
        }, {
          'id': 68,
          'image': 'http://image.yangfankj.com/product/7/0/0.png',
          'name': '百事可乐',
          'price': 3,
          'model': '红,小',
          'nums': 3
        }
      ]
    },
    {
      shop: {id: '', name: '阳阳五金店', logo: 'https://yangfan-shop.oss-cn-hangzhou.aliyuncs.com/shop/logo/1.jpg'},
      productList: [
        {
          'id': 69,
          'image': 'http://image.yangfankj.com/product/8/8/0.png',
          'name': '同仁堂-蛇毒 眼霜',
          'price': 78,
          'model': '白,大',
          'nums': 4
        }, {
          'id': 68,
          'image': 'http://image.yangfankj.com/product/7/0/0.png',
          'name': '百事可乐',
          'price': 3,
          'model': '红,小',
          'nums': 3
        }
      ]
    }
  ],
  couponList: [
    {
      'id': 1,
      'productClassifyName': '全部',
      'shopId': 0,
      'shopName': '',
      'shopLogo': '',
      'fullMoney': 100,
      'reduceMoney': 50,
      'getDay': '2022-08-05',
      'endDay': '2022-08-31',
      'status': 0
    },
    {
      'id': 2,
      'productClassifyName': '全部',
      'shopId': 11,
      'shopName': '国美电器',
      'shopLogo': 'http://image.yangfankj.com/tinyshop/shop/11.png',
      'fullMoney': 200,
      'reduceMoney': 70,
      'getDay': '2022-08-05',
      'endDay': '2022-08-31',
      'status': 0
    },
    {
      'id': 3,
      'productClassifyName': '电子商品',
      'shopId': 11,
      'shopName': '国美电器',
      'shopLogo': 'http://image.yangfankj.com/tinyshop/shop/11.png',
      'fullMoney': 300,
      'reduceMoney': 100,
      'getDay': '2022-08-10',
      'endDay': '2022-09-15',
      'status': 0
    },
    {
      'id': 4,
      'productClassifyName': '建材',
      'shopId': 0,
      'shopName': '',
      'shopLogo': '',
      'fullMoney': 300,
      'reduceMoney': 100,
      'getDay': '2022-08-10',
      'endDay': '2022-09-15',
      'status': 1
    },
    {
      'id': 5,
      'productClassifyName': '全部',
      'shopId': 0,
      'shopName': '',
      'shopLogo': '',
      'fullMoney': 200,
      'reduceMoney': 70,
      'getDay': '2022-08-05',
      'endDay': '2022-08-31',
      'status': 0
    },
    {
      'id': 6,
      'productClassifyName': '全部',
      'shopId': 7,
      'shopName': '唐久便利',
      'shopLogo': 'http://image.yangfankj.com/tinyshop/shop/7.png',
      'fullMoney': 50,
      'reduceMoney': 10,
      'getDay': '2022-08-05',
      'endDay': '2022-08-31',
      'status': 0
    },
    {
      'id': 7,
      'productClassifyName': '全部',
      'shopId': 7,
      'shopName': '唐久便利',
      'shopLogo': 'http://image.yangfankj.com/tinyshop/shop/7.png',
      'fullMoney': 100,
      'reduceMoney': 50,
      'getDay': '2022-08-05',
      'endDay': '2022-08-31',
      'status': 0
    }
  ],
  chatList: [
    {
      'id': 1,
      'fromUserId': 22,
      'fromUserName': '愚笨',
      'fromUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'fromUserType': 'Member',
      'fromMainId': 0,
      'fromMainName': null,
      'fromMainIcon': null,
      'messageType': 'text',
      'message': '你好。',
      'toUserId': 52,
      'toUserName': '单战尐女',
      'toUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'toUserType': 'Shop',
      'toMainId': 7,
      'toMainName': '唐久便利',
      'toMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'isRead': 1,
      'createdTime': '2022-08-28 13:30:20'
    },
    {
      'id': 2,
      'fromUserId': 22,
      'fromUserName': '愚笨',
      'fromUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'fromUserType': 'Member',
      'fromMainId': 0,
      'fromMainName': null,
      'fromMainIcon': null,
      'messageType': 'text',
      'message': '有人在吗，我可以问你们一些问题吗？',
      'toUserId': 52,
      'toUserName': '单战尐女',
      'toUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'toUserType': 'Shop',
      'toMainId': 7,
      'toMainName': '唐久便利',
      'toMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'isRead': 1,
      'createdTime': '2022-08-28 13:31:11'
    },
    {
      'id': 3,
      'fromUserId': 52,
      'fromUserName': '单战尐女',
      'fromUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'fromUserType': 'Shop',
      'fromMainId': 7,
      'fromMainName': '唐久便利',
      'fromMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'messageType': 'text',
      'message': '商品相关问题，我可以帮你解答。',
      'toUserId': 22,
      'toUserName': '愚笨',
      'toUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'toUserType': 'Member',
      'toMainId': 0,
      'toMainName': null,
      'toMainIcon': null,
      'isRead': 1,
      'createdTime': '2022-08-28 13:31:23'
    },
    {
      'id': 4,
      'fromUserId': 22,
      'fromUserName': '愚笨',
      'fromUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'fromUserType': 'Member',
      'fromMainId': 0,
      'fromMainName': null,
      'fromMainIcon': null,
      'messageType': 'text',
      'message': '我们这里有个聚会需要一些零食和饮料？',
      'toUserId': 52,
      'toUserName': '单战尐女',
      'toUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'toUserType': 'Shop',
      'toMainId': 7,
      'toMainName': '唐久便利',
      'toMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'isRead': 1,
      'createdTime': '2022-08-28 13:32:05'
    },
    {
      'id': 5,
      'fromUserId': 22,
      'fromUserName': '愚笨',
      'fromUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'fromUserType': 'Member',
      'fromMainId': 0,
      'fromMainName': null,
      'fromMainIcon': null,
      'messageType': 'text',
      'message': '你们能给我们送过来吗？',
      'toUserId': 52,
      'toUserName': '单战尐女',
      'toUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'toUserType': 'Shop',
      'toMainId': 7,
      'toMainName': '唐久便利',
      'toMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'isRead': 1,
      'createdTime': '2022-08-28 13:32:35'
    },
    {
      'id': 6,
      'fromUserId': 52,
      'fromUserName': '单战尐女',
      'fromUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'fromUserType': 'Shop',
      'fromMainId': 7,
      'fromMainName': '唐久便利',
      'fromMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'messageType': 'text',
      'message': '你们几点要？',
      'toUserId': 22,
      'toUserName': '愚笨',
      'toUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'toUserType': 'Member',
      'toMainId': 0,
      'toMainName': null,
      'toMainIcon': null,
      'isRead': 1,
      'createdTime': '2022-08-28 13:33:45'
    },
    {
      'id': 7,
      'fromUserId': 22,
      'fromUserName': '愚笨',
      'fromUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'fromUserType': 'Member',
      'fromMainId': 0,
      'fromMainName': null,
      'fromMainIcon': null,
      'messageType': 'text',
      'message': '下午3.30左右吧。',
      'toUserId': 52,
      'toUserName': '单战尐女',
      'toUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'toUserType': 'Shop',
      'toMainId': 7,
      'toMainName': '唐久便利',
      'toMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'isRead': 1,
      'createdTime': '2022-08-28 13:40:16'
    },
    {
      'id': 8,
      'fromUserId': 52,
      'fromUserName': '单战尐女',
      'fromUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'fromUserType': 'Shop',
      'fromMainId': 7,
      'fromMainName': '唐久便利',
      'fromMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'messageType': 'text',
      'message': '可以的，你们留个电话吧。到时候联系你们。',
      'toUserId': 22,
      'toUserName': '愚笨',
      'toUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'toUserType': 'Member',
      'toMainId': 0,
      'toMainName': null,
      'toMainIcon': null,
      'isRead': 0,
      'createdTime': '2022-08-28 13:45:19'
    },
    {
      'id': 9,
      'fromUserId': 22,
      'fromUserName': '愚笨',
      'fromUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'fromUserType': 'Member',
      'fromMainId': 0,
      'fromMainName': null,
      'fromMainIcon': null,
      'messageType': 'text',
      'message': '我们等会去App下单就好。',
      'toUserId': 52,
      'toUserName': '单战尐女',
      'toUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'toUserType': 'Shop',
      'toMainId': 7,
      'toMainName': '唐久便利',
      'toMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'isRead': 0,
      'createdTime': '2022-08-28 13:46:16'
    },
    {
      'id': 10,
      'fromUserId': 52,
      'fromUserName': '单战尐女',
      'fromUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'fromUserType': 'Shop',
      'fromMainId': 7,
      'fromMainName': '唐久便利',
      'fromMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'messageType': 'text',
      'message': 'OK',
      'toUserId': 22,
      'toUserName': '愚笨',
      'toUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'toUserType': 'Member',
      'toMainId': 0,
      'toMainName': null,
      'toMainIcon': null,
      'isRead': 0,
      'createdTime': '2022-08-28 13:51:19'
    },
    {
      'id': 25,
      'fromUserId': 52,
      'fromUserName': '单战尐女',
      'fromUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'fromUserType': 'Shop',
      'fromMainId': 7,
      'fromMainName': '唐久便利',
      'fromMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'messageType': 'text',
      'message': '测试512',
      'toUserId': 22,
      'toUserName': '愚笨',
      'toUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'toUserType': 'Member',
      'toMainId': 0,
      'toMainName': null,
      'toMainIcon': null,
      'isRead': 0,
      'createdTime': '2022-08-29 04:31:56'
    },
    {
      'id': 26,
      'fromUserId': 52,
      'fromUserName': '单战尐女',
      'fromUserIcon': 'http://image.yangfankj.com/icon/23.png',
      'fromUserType': 'Shop',
      'fromMainId': 7,
      'fromMainName': '唐久便利',
      'fromMainIcon': 'http://image.yangfankj.com/shop/logo/7.jpg',
      'messageType': 'text',
      'message': '测试432',
      'toUserId': 22,
      'toUserName': '愚笨',
      'toUserIcon': 'http://image.yangfankj.com/icon/19.png',
      'toUserType': 'Member',
      'toMainId': 0,
      'toMainName': null,
      'toMainIcon': null,
      'isRead': 0,
      'createdTime': '2022-08-29 04:43:39'
    }
  ],
  member: {
    'username': '15200000020',
    'nickname': '腥鲜。尐女ε.ら',
    'sex': '女',
    'birthday': '1991-08-11',
    'money': 10000,
    'commission': 0,
    'icon': 'http://image.yangfankj.com/icon/19.png',
    'level': 0,
    'score': 0,
    'orderNums': {count: 0, needPayNums: 2, needSendNums: 2, needReceiveNums: 5, needReplyNums: 0, refundingNums: 0}
  },
  address: {
    'id': 8,
    'name': '赵女士',
    'mobile': '17766633331',
    'province': '陕西省',
    'city': '西安市',
    'county': '雁塔区',
    'location': '108.971832,34.213888',
    'address': '雁塔南路曲江温德姆酒店G层',
    'isDefault': 1
  },
  addressList: [
    {
      'id': 3,
      'name': '王女士',
      'mobile': '17766633331',
      'province': '陕西省',
      'city': '西安市',
      'county': '长安区',
      'location': '108.93415,34.164429',
      'address': '广场北路长安广场西北侧约30米',
      'isDefault': 0
    },
    {
      'id': 8,
      'name': '赵女士',
      'mobile': '17766633331',
      'province': '陕西省',
      'city': '西安市',
      'county': '雁塔区',
      'location': '108.971832,34.213888',
      'address': '雁塔南路曲江温德姆酒店G层',
      'isDefault': 1
    }
  ],
  productList: [
    {
      'id': 69,
      'shopId': 14,
      'shopName': '小朱便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/14.jpg',
      'hotTag': [],
      'name': '同仁堂-蛇毒 眼霜',
      'classifyName': '眼霜',
      'brandName': '同仁堂',
      'price': 78,
      'saleNums': 0,
      'image': 'http://image.yangfankj.com/product/8/8/0.png',
      'score': 80
    },
    {
      'id': 68,
      'shopId': 14,
      'shopName': '小朱便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/14.jpg',
      'hotTag': [],
      'name': '百事可乐',
      'classifyName': '饮料',
      'brandName': '百事可乐',
      'price': 3,
      'saleNums': 0,
      'image': 'http://image.yangfankj.com/product/7/0/0.png',
      'score': 80
    },
    {
      'id': 67,
      'shopId': 14,
      'shopName': '小朱便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/14.jpg',
      'hotTag': [],
      'name': '京东造-浴巾',
      'classifyName': '浴巾',
      'brandName': '京东造',
      'price': 89,
      'saleNums': 0,
      'image': 'http://image.yangfankj.com/product/107/0.jpg',
      'score': 80
    },
    {
      'id': 66,
      'shopId': 14,
      'shopName': '小朱便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/14.jpg',
      'hotTag': [],
      'name': '佳奥-抱枕',
      'classifyName': '抱枕',
      'brandName': '佳奥',
      'price': 59,
      'saleNums': 846,
      'image': 'http://image.yangfankj.com/product/106/0.jpg',
      'score': 80
    },
    {
      'id': 65,
      'shopId': 14,
      'shopName': '小朱便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/14.jpg',
      'hotTag': [],
      'name': 'AHC 男士护肤品套装',
      'classifyName': '护肤',
      'brandName': 'AHC',
      'price': 116,
      'saleNums': 0,
      'image': 'http://image.yangfankj.com/product/8/0/0.png',
      'score': 89
    },
    {
      'id': 64,
      'shopId': 13,
      'shopName': '每一天便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/13.jpg',
      'hotTag': [],
      'name': '汇源果汁',
      'classifyName': '饮料',
      'brandName': '汇源',
      'price': 60,
      'saleNums': 0,
      'image': 'http://image.yangfankj.com/product/7/4/0.png',
      'score': 80
    },
    {
      'id': 63,
      'shopId': 13,
      'shopName': '每一天便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/13.jpg',
      'hotTag': [],
      'name': '企鹅市集 桂花米酒',
      'classifyName': '酒',
      'brandName': '企鹅市集',
      'price': 60,
      'saleNums': 0,
      'image': 'http://image.yangfankj.com/product/7/8/0.png',
      'score': 80
    },
    {
      'id': 62,
      'shopId': 13,
      'shopName': '每一天便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/13.jpg',
      'hotTag': [],
      'name': '美汁源果粒橙',
      'classifyName': '饮料',
      'brandName': '美汁源',
      'price': 20,
      'saleNums': 0,
      'image': 'http://image.yangfankj.com/product/7/7/0.png',
      'score': 43
    },
    {
      'id': 61,
      'shopId': 13,
      'shopName': '每一天便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/13.jpg',
      'hotTag': [],
      'name': '泸州老窖',
      'classifyName': '酒',
      'brandName': '泸州老窖',
      'price': 56,
      'saleNums': 0,
      'image': 'http://image.yangfankj.com/product/7/6/0.png',
      'score': 80
    },
    {
      'id': 60,
      'shopId': 12,
      'shopName': '华润万家',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/12.jpg',
      'hotTag': [],
      'name': '欧莱雅 男士专用洗面奶',
      'classifyName': '洗面奶',
      'brandName': '欧莱雅',
      'price': 105,
      'saleNums': 0,
      'image': 'http://image.yangfankj.com/product/8/4/0.png',
      'score': 80
    }
  ],
  chooseProductList: [
    {
      'id': 69,
      'shopId': 14,
      'shopName': '小朱便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/14.jpg',
      'name': '同仁堂-蛇毒 眼霜',
      'classifyName': '眼霜',
      'brandName': '同仁堂',
      'price': 78,
      'image': 'http://image.yangfankj.com/product/8/8/0.png',
      'model': '大,白',
      'nums': 2
    },
    {
      'id': 68,
      'shopId': 14,
      'shopName': '小朱便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/14.jpg',
      'name': '百事可乐',
      'classifyName': '饮料',
      'brandName': '百事可乐',
      'price': 3,
      'image': 'http://image.yangfankj.com/product/7/0/0.png',
      'model': '大,白',
      'nums': 5
    },
    {
      'id': 67,
      'shopId': 14,
      'shopName': '小朱便利店',
      'shopLogo': 'http://image.yangfankj.com/shop/logo/14.jpg',
      'name': '京东造-浴巾',
      'classifyName': '浴巾',
      'brandName': '京东造',
      'price': 89,
      'image': 'http://image.yangfankj.com/product/107/0.jpg',
      'model': '大,白',
      'nums': 1
    }
  ],
  productCateList: [
    {name: '服装', icon: './static/product-cate/fuzhuang.png', id: ''},
    {name: '手机', icon: './static/product-cate/shouji.png', id: ''},
    {name: '数码', icon: './static/product-cate/shuma.png', id: ''},
    {name: '家具', icon: './static/product-cate/jiaju.png', id: ''},
    {name: '家电', icon: './static/product-cate/jiadian.png', id: ''},
    {name: '运动', icon: './static/product-cate/yundong.png', id: ''},
    {name: '医药', icon: './static/product-cate/yiyao.png', id: ''},
    {name: '酒水', icon: './static/product-cate/jiushui.png', id: ''},
    {name: '箱包', icon: './static/product-cate/xiangbao.png', id: ''},
    {name: '护肤', icon: './static/product-cate/hufu.png', id: ''},
  ],
  product: {
    name: '南极人 NanJiren 单人水暖毯长毛绒 电热毯TK180×80-1X 水暖炕水电褥子水',
    image: './static/images/product-1.jpg',
    id: 1,
    price: 159.00,
    oldPrice: 219.00,
    secondPrice: 130.00,
    second: 60,
    nums: 2
  },
  shop: {
    id: 1,
    name: '飞扬五金',
    logo: 'http://image.yangfankj.com/shop/logo/2.jpg',
    isCollect: false,
    collectNums: 1123,
    productNums: 66316,
    location: '108.735568,34.211873',
    province: '陕西省',
    city: '西安市',
    county: '长安区',
    address: 'Y244与西宝老线交叉路口往东约150米',
    businessTime: '9:00~21:00',
    sameCitySend: true,
    bannerArr: [
      'http://image.yangfankj.com/shop/banner/0.png',
      'http://image.yangfankj.com/shop/banner/1.png',
      'http://image.yangfankj.com/shop/banner/2.png'
    ]
  }
}
window._AMapSecurityConfig = {
  // serviceHost:'您的代理服务器域名或地址/_AMapService',
  securityJsCode: 'a8637f8fc757e27b95a3f81a79cbd1c0'
  // 例如 ：serviceHost:'http://1.1.1.1:80/_AMapService',
}

document.addEventListener('plusready', function () {
  var first = null
  var webview = plus.webview.currentWebview()

  plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
    //  获取 app的version
    // console.log('wgtinfo',JSON.stringify(wgtinfo))
    localStorage.setItem('AppVersionCode', wgtinfo.versionCode)
    localStorage.setItem('AppVersion', wgtinfo.version)
    // 存缓存 版本号
    try {

    } catch (e) {
    }
  })

  plus.key.addEventListener('backbutton', function () {
    webview.canBack(function (e) {
      if (e.canBack) {
        webview.back() //这里不建议修改自己跳转的路径
      } else {
        //首次按键，提示‘再按一次退出应用’
        if (!first) {
          first = new Date()
            .getTime() //获取第一次点击的时间戳
          // console.log('再按一次退出应用');//用自定义toast提示最好
          // toast('双击返回键退出应用'); //调用自己写的吐丝提示 函数
          plus.nativeUI.toast('再按一次退出应用', {
            duration: 'short'
          }) //通过H5+ API 调用Android 上的toast 提示框
          setTimeout(function () {
            first = null
          }, 1000)
        } else {
          if (new Date()
            .getTime() - first < 1000) { //获取第二次点击的时间戳, 两次之差 小于 1000ms 说明1s点击了两次,
            plus.runtime.quit() //退出应用
          }
        }
      }
    })
  })
})
